#include "PDTSequenceVar.h"
#include "PDTCodeGraph.h"
#include "PDTVecConst.h"



PDTSequenceVar :: PDTSequenceVar (PDTCodeGraph & CG, PDTSequence & aSequence, string name) :
    	PDTSetVar(CG, aSequence, name) 
{
    CG.addVar(this);
    cloneID = 0;
}

PDTNode* 
PDTSequenceVar :: getValue()
{
    PDTConstSequence* seqOld = dynamic_cast<PDTConstSequence*>(nValue);
    vector <PDTNode *> * nodeVector;
    nodeVector = seqOld->getVector();
    nodeVector->clear();
    for (unsigned int i = 0; i<getSequence()->elements.size(); i++)
    {
        nodeVector->push_back(getSequence()->getElement(i));
    }
    nValue = seqOld;
    return nValue;
}

